package com.zHan.sky.controller.User;

import com.zHan.sky.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

/**
 * ClassName: ShopController
 * Description: 用户端店铺管理
 * date: 2023/7/29 0029 11:55
 *
 * @author zHan
 */
@RestController("userShopController")
@Slf4j
@Api(tags = "C端-店铺相关接口")
@RequestMapping("/user/shop")
public class ShopController {

    @Autowired
    private RedisTemplate redisTemplate;

    public static final String SHOP_KEY= "shop_status";

    /**
     * 查询店铺的营业状态
     * @param status
     * @return
     */
    @GetMapping("/status")
    @ApiOperation(value = "查询店铺的营业状态")
    public Result getStatus(Integer status) {
        Integer shop_status = (Integer) redisTemplate.opsForValue().get(SHOP_KEY);
        return Result.success(shop_status);
    }
}
